using System;
using System.ComponentModel;
using System.Collections.Generic;

using Castle.ActiveRecord;

/// <summary>
/// Business entity class generated from Account
/// </summary>
/// <remarks>
/// Created by: huanhvhd
/// Created date: [2011-04-23]
/// </remarks>
namespace TVN.ShopMan.ActiveModels
{
	[ActiveRecord("Account")]
	public partial class Account : ActiveRecordBase<Account>
	{
		#region Properties
		
        /// <summary>
        /// All properties
        /// </summary>
		public class Properties
		{
			public const string Id = "Id";
			public const string Username = "Username";
			public const string Password = "Password";
			public const string FullName = "FullName";
			public const string Email = "Email";
			public const string IsActive = "IsActive";
			public const string CreatedDate = "CreatedDate";
			public const string LastModifiedDate = "LastModifiedDate";
			public const string Creator = "Creator";
			public const string LastModifier = "LastModifier";
		}

		#endregion

		#region Private fields

		private int _id;
		private string _username;
		private string _password;
		private string _fullName;
		private string _email;
		private bool _isActive;
		private DateTime _createdDate;
		private DateTime? _lastModifiedDate;
		private Account _creatorId;
		private Account _lastModifierId;

		private IList<Account> _accountsCreatorId = new List<Account>();
		private IList<Account> _accountsLastModifierId = new List<Account>();
		private IList<AccountPhoneNumber> _accountPhoneNumbersAccountId = new List<AccountPhoneNumber>();
		private IList<AccountRepository> _accountRepositoriesAccountId = new List<AccountRepository>();
		private IList<AccountRepository> _accountRepositoriesCreatorId = new List<AccountRepository>();
		private IList<AccountRepository> _accountRepositoriesLastModifierId = new List<AccountRepository>();
		private IList<ContactPoint> _contactPointsCreatorId = new List<ContactPoint>();
		private IList<ContactPoint> _contactPointsLastModifierId = new List<ContactPoint>();
		private IList<GenericData> _genericDatasCreatorId = new List<GenericData>();
		private IList<GenericData> _genericDatasLastModifierId = new List<GenericData>();
		private IList<OrderSummary> _orderSummariesCreatorId = new List<OrderSummary>();
		private IList<OrderSummary> _orderSummariesLastModifierId = new List<OrderSummary>();
		private IList<PhoneNumber> _phoneNumbersCreatorId = new List<PhoneNumber>();
		private IList<PhoneNumber> _phoneNumbersLastModifierId = new List<PhoneNumber>();
		private IList<Product> _productsCreatorId = new List<Product>();
		private IList<Product> _productsLastModifierId = new List<Product>();
		private IList<ProductRepository> _productRepositoriesCreatorId = new List<ProductRepository>();
		private IList<ProductRepository> _productRepositoriesLastModifierId = new List<ProductRepository>();
		private IList<Repository> _repositoriesCreatorId = new List<Repository>();
		private IList<Repository> _repositoriesLastModifierId = new List<Repository>();
		private IList<Repository> _repositoriesOwnerId = new List<Repository>();
		private IList<Supplier> _suppliersCreatorId = new List<Supplier>();
		private IList<Supplier> _suppliersLastModifierId = new List<Supplier>();
		private IList<Unit> _unitsCreatorId = new List<Unit>();
		private IList<Unit> _unitsLastModifierId = new List<Unit>();

		#endregion

		#region Constructors

		public Account()
		{
		}

		#endregion

		#region Properties

		[PrimaryKey("Id", Access = PropertyAccess.NosetterLowercaseUnderscore)]
		public int Id
		{
			get { return _id; }
		}

		[Property("Username", NotNull = true, Length = 256)]
		public string Username
		{
			get { return _username; }
			set { _username = value; }
		}

		[Property("Password", NotNull = true, Length = 256)]
		public string Password
		{
			get { return _password; }
			set { _password = value; }
		}

		[Property("FullName", NotNull = true, Length = 256)]
		public string FullName
		{
			get { return _fullName; }
			set { _fullName = value; }
		}

		[Property("Email", Length = 256)]
		public string Email
		{
			get { return _email; }
			set { _email = value; }
		}

		[Property("IsActive", NotNull = true)]
		public bool IsActive
		{
			get { return _isActive; }
			set { _isActive = value; }
		}

		[Property("CreatedDate", NotNull = true)]
		public DateTime CreatedDate
		{
			get { return _createdDate; }
			set { _createdDate = value; }
		}

		[Property("LastModifiedDate")]
		public DateTime? LastModifiedDate
		{
			get { return _lastModifiedDate; }
			set { _lastModifiedDate = value; }
		}

		[BelongsTo("CreatorId", Type = typeof(Account))]
		public Account Creator
		{
			get { return _creatorId; }
			set { _creatorId = value; }
		}

		[BelongsTo("LastModifierId", Type = typeof(Account))]
		public Account LastModifier
		{
			get { return _lastModifierId; }
			set { _lastModifierId = value; }
		}

		[HasMany(typeof(Account), Table="Account", ColumnKey="CreatorId")]
		public IList<Account> AccountsCreatorId
		{
			get { return _accountsCreatorId; }
			set { _accountsCreatorId = value; }
		}
		[HasMany(typeof(Account), Table="Account", ColumnKey="LastModifierId")]
		public IList<Account> AccountsLastModifierId
		{
			get { return _accountsLastModifierId; }
			set { _accountsLastModifierId = value; }
		}
		[HasMany(typeof(AccountPhoneNumber), Table="AccountPhoneNumber", ColumnKey="AccountId")]
		public IList<AccountPhoneNumber> AccountPhoneNumbersAccountId
		{
			get { return _accountPhoneNumbersAccountId; }
			set { _accountPhoneNumbersAccountId = value; }
		}
		[HasMany(typeof(AccountRepository), Table="AccountRepository", ColumnKey="AccountId")]
		public IList<AccountRepository> AccountRepositoriesAccountId
		{
			get { return _accountRepositoriesAccountId; }
			set { _accountRepositoriesAccountId = value; }
		}
		[HasMany(typeof(AccountRepository), Table="AccountRepository", ColumnKey="CreatorId")]
		public IList<AccountRepository> AccountRepositoriesCreatorId
		{
			get { return _accountRepositoriesCreatorId; }
			set { _accountRepositoriesCreatorId = value; }
		}
		[HasMany(typeof(AccountRepository), Table="AccountRepository", ColumnKey="LastModifierId")]
		public IList<AccountRepository> AccountRepositoriesLastModifierId
		{
			get { return _accountRepositoriesLastModifierId; }
			set { _accountRepositoriesLastModifierId = value; }
		}
		[HasMany(typeof(ContactPoint), Table="ContactPoint", ColumnKey="CreatorId")]
		public IList<ContactPoint> ContactPointsCreatorId
		{
			get { return _contactPointsCreatorId; }
			set { _contactPointsCreatorId = value; }
		}
		[HasMany(typeof(ContactPoint), Table="ContactPoint", ColumnKey="LastModifierId")]
		public IList<ContactPoint> ContactPointsLastModifierId
		{
			get { return _contactPointsLastModifierId; }
			set { _contactPointsLastModifierId = value; }
		}
		[HasMany(typeof(GenericData), Table="GenericData", ColumnKey="CreatorId")]
		public IList<GenericData> GenericDatasCreatorId
		{
			get { return _genericDatasCreatorId; }
			set { _genericDatasCreatorId = value; }
		}
		[HasMany(typeof(GenericData), Table="GenericData", ColumnKey="LastModifierId")]
		public IList<GenericData> GenericDatasLastModifierId
		{
			get { return _genericDatasLastModifierId; }
			set { _genericDatasLastModifierId = value; }
		}
		[HasMany(typeof(OrderSummary), Table="OrderSummary", ColumnKey="CreatorId")]
		public IList<OrderSummary> OrderSummariesCreatorId
		{
			get { return _orderSummariesCreatorId; }
			set { _orderSummariesCreatorId = value; }
		}
		[HasMany(typeof(OrderSummary), Table="OrderSummary", ColumnKey="LastModifierId")]
		public IList<OrderSummary> OrderSummariesLastModifierId
		{
			get { return _orderSummariesLastModifierId; }
			set { _orderSummariesLastModifierId = value; }
		}
		[HasMany(typeof(PhoneNumber), Table="PhoneNumber", ColumnKey="CreatorId")]
		public IList<PhoneNumber> PhoneNumbersCreatorId
		{
			get { return _phoneNumbersCreatorId; }
			set { _phoneNumbersCreatorId = value; }
		}
		[HasMany(typeof(PhoneNumber), Table="PhoneNumber", ColumnKey="LastModifierId")]
		public IList<PhoneNumber> PhoneNumbersLastModifierId
		{
			get { return _phoneNumbersLastModifierId; }
			set { _phoneNumbersLastModifierId = value; }
		}
		[HasMany(typeof(Product), Table="Product", ColumnKey="CreatorId")]
		public IList<Product> ProductsCreatorId
		{
			get { return _productsCreatorId; }
			set { _productsCreatorId = value; }
		}
		[HasMany(typeof(Product), Table="Product", ColumnKey="LastModifierId")]
		public IList<Product> ProductsLastModifierId
		{
			get { return _productsLastModifierId; }
			set { _productsLastModifierId = value; }
		}
		[HasMany(typeof(ProductRepository), Table="ProductRepository", ColumnKey="CreatorId")]
		public IList<ProductRepository> ProductRepositoriesCreatorId
		{
			get { return _productRepositoriesCreatorId; }
			set { _productRepositoriesCreatorId = value; }
		}
		[HasMany(typeof(ProductRepository), Table="ProductRepository", ColumnKey="LastModifierId")]
		public IList<ProductRepository> ProductRepositoriesLastModifierId
		{
			get { return _productRepositoriesLastModifierId; }
			set { _productRepositoriesLastModifierId = value; }
		}
		[HasMany(typeof(Repository), Table="Repository", ColumnKey="CreatorId")]
		public IList<Repository> RepositoriesCreatorId
		{
			get { return _repositoriesCreatorId; }
			set { _repositoriesCreatorId = value; }
		}
		[HasMany(typeof(Repository), Table="Repository", ColumnKey="LastModifierId")]
		public IList<Repository> RepositoriesLastModifierId
		{
			get { return _repositoriesLastModifierId; }
			set { _repositoriesLastModifierId = value; }
		}
		[HasMany(typeof(Repository), Table="Repository", ColumnKey="OwnerId")]
		public IList<Repository> RepositoriesOwnerId
		{
			get { return _repositoriesOwnerId; }
			set { _repositoriesOwnerId = value; }
		}
		[HasMany(typeof(Supplier), Table="Supplier", ColumnKey="CreatorId")]
		public IList<Supplier> SuppliersCreatorId
		{
			get { return _suppliersCreatorId; }
			set { _suppliersCreatorId = value; }
		}
		[HasMany(typeof(Supplier), Table="Supplier", ColumnKey="LastModifierId")]
		public IList<Supplier> SuppliersLastModifierId
		{
			get { return _suppliersLastModifierId; }
			set { _suppliersLastModifierId = value; }
		}
		[HasMany(typeof(Unit), Table="Unit", ColumnKey="CreatorId")]
		public IList<Unit> UnitsCreatorId
		{
			get { return _unitsCreatorId; }
			set { _unitsCreatorId = value; }
		}
		[HasMany(typeof(Unit), Table="Unit", ColumnKey="LastModifierId")]
		public IList<Unit> UnitsLastModifierId
		{
			get { return _unitsLastModifierId; }
			set { _unitsLastModifierId = value; }
		}
		#endregion

	} }
